\(\int \frac {a+b \log (c (d+e x)^n)}{(f+\frac {g}{x})^3 x^3} \, dx\) [308]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 112 \[ \int \frac {a+b \log \left (c (d+e x)^n\right )}{\left (f+\frac {g}{x}\right )^3 x^3} \, dx=-\frac {b e n}{2 f (d f-e g) (g+f x)}+\frac {b e^2 n \log (d+e x)}{2 f (d f-e g)^2}-\frac {a+b \log \left (c (d+e x)^n\right )}{2 f (g+f x)^2}-\frac {b e^2 n \log (g+f x)}{2 f (d f-e g)^2} \]

[Out]

-1/2*b*e*n/f/(d*f-e*g)/(f*x+g)+1/2*b*e^2*n*ln(e*x+d)/f/(d*f-e*g)^2+1/2*(-a-b*ln(c*(e*x+d)^n))/f/(f*x+g)^2-1/2*
b*e^2*n*ln(f*x+g)/f/(d*f-e*g)^2

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2459, 2442, 46} \[ \int \frac {a+b \log \left (c (d+e x)^n\right )}{\left (f+\frac {g}{x}\right )^3 x^3} \, dx=-\frac {a+b \log \left (c (d+e x)^n\right )}{2 f (f x+g)^2}+\frac {b e^2 n \log (d+e x)}{2 f (d f-e g)^2}-\frac {b e^2 n \log (f x+g)}{2 f (d f-e g)^2}-\frac {b e n}{2 f (f x+g) (d f-e g)} \]

[In]

Int[(a + b*Log[c*(d + e*x)^n])/((f + g/x)^3*x^3),x]

[Out]

-1/2*(b*e*n)/(f*(d*f - e*g)*(g + f*x)) + (b*e^2*n*Log[d + e*x])/(2*f*(d*f - e*g)^2) - (a + b*Log[c*(d + e*x)^n
])/(2*f*(g + f*x)^2) - (b*e^2*n*Log[g + f*x])/(2*f*(d*f - e*g)^2)

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 2442

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[(f + g*
x)^(q + 1)*((a + b*Log[c*(d + e*x)^n])/(g*(q + 1))), x] - Dist[b*e*(n/(g*(q + 1))), Int[(f + g*x)^(q + 1)/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

Rule 2459

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_.)/(x_))^(q_.)*(x_)^(m_.), x_Symbol]
 :> Int[(g + f*x)^q*(a + b*Log[c*(d + e*x)^n])^p, x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, q}, x] && EqQ[m,
q] && IntegerQ[q]

Rubi steps \begin{align*} \text {integral}& = \int \frac {a+b \log \left (c (d+e x)^n\right )}{(g+f x)^3} \, dx \\ & = -\frac {a+b \log \left (c (d+e x)^n\right )}{2 f (g+f x)^2}+\frac {(b e n) \int \frac {1}{(d+e x) (g+f x)^2} \, dx}{2 f} \\ & = -\frac {a+b \log \left (c (d+e x)^n\right )}{2 f (g+f x)^2}+\frac {(b e n) \int \left (\frac {e^2}{(d f-e g)^2 (d+e x)}+\frac {f}{(d f-e g) (g+f x)^2}-\frac {e f}{(d f-e g)^2 (g+f x)}\right ) \, dx}{2 f} \\ & = -\frac {b e n}{2 f (d f-e g) (g+f x)}+\frac {b e^2 n \log (d+e x)}{2 f (d f-e g)^2}-\frac {a+b \log \left (c (d+e x)^n\right )}{2 f (g+f x)^2}-\frac {b e^2 n \log (g+f x)}{2 f (d f-e g)^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 83, normalized size of antiderivative = 0.74 \[ \int \frac {a+b \log \left (c (d+e x)^n\right )}{\left (f+\frac {g}{x}\right )^3 x^3} \, dx=-\frac {a+b \log \left (c (d+e x)^n\right )-\frac {b e n (g+f x) (-d f+e g+e (g+f x) \log (d+e x)-e (g+f x) \log (g+f x))}{(d f-e g)^2}}{2 f (g+f x)^2} \]

[In]

Integrate[(a + b*Log[c*(d + e*x)^n])/((f + g/x)^3*x^3),x]

[Out]

-1/2*(a + b*Log[c*(d + e*x)^n] - (b*e*n*(g + f*x)*(-(d*f) + e*g + e*(g + f*x)*Log[d + e*x] - e*(g + f*x)*Log[g
 + f*x]))/(d*f - e*g)^2)/(f*(g + f*x)^2)

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(282\) vs. \(2(107)=214\).

Time = 0.61 (sec) , antiderivative size = 283, normalized size of antiderivative = 2.53

method result size
parallelrisch \(\frac {-a \,d^{2} e \,f^{3}-a \,e^{3} f \,g^{2}-\ln \left (c \left (e x +d \right )^{n}\right ) b \,d^{2} e \,f^{3}-\ln \left (c \left (e x +d \right )^{n}\right ) b \,e^{3} f \,g^{2}-\ln \left (f x +g \right ) b \,e^{3} f \,g^{2} n -x b d \,e^{2} f^{3} n +2 \ln \left (c \left (e x +d \right )^{n}\right ) b d \,e^{2} f^{2} g -b d \,e^{2} f^{2} n g +b \,e^{3} f^{2} g n x +2 a d \,e^{2} f^{2} g +b \,e^{3} f \,g^{2} n +2 \ln \left (e x +d \right ) b \,e^{3} f^{2} g n x +\ln \left (e x +d \right ) x^{2} b \,e^{3} f^{3} n -\ln \left (f x +g \right ) x^{2} b \,e^{3} f^{3} n -2 \ln \left (f x +g \right ) x b \,e^{3} f^{2} g n +\ln \left (e x +d \right ) b \,e^{3} f \,g^{2} n}{2 \left (f^{2} d^{2}-2 d e f g +e^{2} g^{2}\right ) \left (f x +g \right )^{2} e \,f^{2}}\) \(283\)
risch \(-\frac {b \ln \left (\left (e x +d \right )^{n}\right )}{2 f \left (f x +g \right )^{2}}-\frac {2 \ln \left (c \right ) b \,d^{2} f^{2}+2 \ln \left (c \right ) b \,e^{2} g^{2}-4 \ln \left (c \right ) b d e f g +2 i \pi b d e f g \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}-i \pi b \,e^{2} g^{2} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )-i \pi b \,d^{2} f^{2} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )+2 g b d e f n -i \pi b \,d^{2} f^{2} \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}-i \pi b \,e^{2} g^{2} \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}+2 b d e \,f^{2} n x +2 i \pi b d e f g \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )+2 a \,e^{2} g^{2}-2 i \pi b d e f g \,\operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}-2 i \pi b d e f g \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}-2 b \,e^{2} g^{2} n -4 \ln \left (-e x -d \right ) b \,e^{2} f g n x -4 a d e f g -2 \ln \left (-e x -d \right ) b \,e^{2} g^{2} n +2 \ln \left (f x +g \right ) b \,e^{2} g^{2} n +4 \ln \left (f x +g \right ) b \,e^{2} f g n x +2 a \,d^{2} f^{2}-2 \ln \left (-e x -d \right ) b \,e^{2} f^{2} n \,x^{2}+2 \ln \left (f x +g \right ) b \,e^{2} f^{2} n \,x^{2}-2 b \,e^{2} f g n x +i \pi b \,e^{2} g^{2} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}+i \pi b \,e^{2} g^{2} \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}+i \pi b \,d^{2} f^{2} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}+i \pi b \,d^{2} f^{2} \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{4 \left (f x +g \right )^{2} \left (d f -e g \right )^{2} f}\) \(633\)

[In]

int((a+b*ln(c*(e*x+d)^n))/(f+g/x)^3/x^3,x,method=_RETURNVERBOSE)

[Out]

1/2*(-a*d^2*e*f^3-a*e^3*f*g^2-ln(c*(e*x+d)^n)*b*d^2*e*f^3-ln(c*(e*x+d)^n)*b*e^3*f*g^2-ln(f*x+g)*b*e^3*f*g^2*n-
x*b*d*e^2*f^3*n+2*ln(c*(e*x+d)^n)*b*d*e^2*f^2*g-b*d*e^2*f^2*n*g+b*e^3*f^2*g*n*x+2*a*d*e^2*f^2*g+b*e^3*f*g^2*n+
2*ln(e*x+d)*b*e^3*f^2*g*n*x+ln(e*x+d)*x^2*b*e^3*f^3*n-ln(f*x+g)*x^2*b*e^3*f^3*n-2*ln(f*x+g)*x*b*e^3*f^2*g*n+ln
(e*x+d)*b*e^3*f*g^2*n)/(d^2*f^2-2*d*e*f*g+e^2*g^2)/(f*x+g)^2/e/f^2

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 272 vs. \(2 (104) = 208\).

Time = 0.33 (sec) , antiderivative size = 272, normalized size of antiderivative = 2.43 \[ \int \frac {a+b \log \left (c (d+e x)^n\right )}{\left (f+\frac {g}{x}\right )^3 x^3} \, dx=-\frac {a d^{2} f^{2} - 2 \, a d e f g + a e^{2} g^{2} + {\left (b d e f^{2} - b e^{2} f g\right )} n x + {\left (b d e f g - b e^{2} g^{2}\right )} n - {\left (b e^{2} f^{2} n x^{2} + 2 \, b e^{2} f g n x - {\left (b d^{2} f^{2} - 2 \, b d e f g\right )} n\right )} \log \left (e x + d\right ) + {\left (b e^{2} f^{2} n x^{2} + 2 \, b e^{2} f g n x + b e^{2} g^{2} n\right )} \log \left (f x + g\right ) + {\left (b d^{2} f^{2} - 2 \, b d e f g + b e^{2} g^{2}\right )} \log \left (c\right )}{2 \, {\left (d^{2} f^{3} g^{2} - 2 \, d e f^{2} g^{3} + e^{2} f g^{4} + {\left (d^{2} f^{5} - 2 \, d e f^{4} g + e^{2} f^{3} g^{2}\right )} x^{2} + 2 \, {\left (d^{2} f^{4} g - 2 \, d e f^{3} g^{2} + e^{2} f^{2} g^{3}\right )} x\right )}} \]

[In]

integrate((a+b*log(c*(e*x+d)^n))/(f+g/x)^3/x^3,x, algorithm="fricas")

[Out]

-1/2*(a*d^2*f^2 - 2*a*d*e*f*g + a*e^2*g^2 + (b*d*e*f^2 - b*e^2*f*g)*n*x + (b*d*e*f*g - b*e^2*g^2)*n - (b*e^2*f
^2*n*x^2 + 2*b*e^2*f*g*n*x - (b*d^2*f^2 - 2*b*d*e*f*g)*n)*log(e*x + d) + (b*e^2*f^2*n*x^2 + 2*b*e^2*f*g*n*x +
b*e^2*g^2*n)*log(f*x + g) + (b*d^2*f^2 - 2*b*d*e*f*g + b*e^2*g^2)*log(c))/(d^2*f^3*g^2 - 2*d*e*f^2*g^3 + e^2*f
*g^4 + (d^2*f^5 - 2*d*e*f^4*g + e^2*f^3*g^2)*x^2 + 2*(d^2*f^4*g - 2*d*e*f^3*g^2 + e^2*f^2*g^3)*x)

Sympy [F(-1)]

Timed out. \[ \int \frac {a+b \log \left (c (d+e x)^n\right )}{\left (f+\frac {g}{x}\right )^3 x^3} \, dx=\text {Timed out} \]

[In]

integrate((a+b*ln(c*(e*x+d)**n))/(f+g/x)**3/x**3,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.51 \[ \int \frac {a+b \log \left (c (d+e x)^n\right )}{\left (f+\frac {g}{x}\right )^3 x^3} \, dx=\frac {1}{2} \, b e n {\left (\frac {e \log \left (e x + d\right )}{d^{2} f^{3} - 2 \, d e f^{2} g + e^{2} f g^{2}} - \frac {e \log \left (f x + g\right )}{d^{2} f^{3} - 2 \, d e f^{2} g + e^{2} f g^{2}} - \frac {1}{d f^{2} g - e f g^{2} + {\left (d f^{3} - e f^{2} g\right )} x}\right )} - \frac {b \log \left ({\left (e x + d\right )}^{n} c\right )}{2 \, {\left (f^{3} x^{2} + 2 \, f^{2} g x + f g^{2}\right )}} - \frac {a}{2 \, {\left (f^{3} x^{2} + 2 \, f^{2} g x + f g^{2}\right )}} \]

[In]

integrate((a+b*log(c*(e*x+d)^n))/(f+g/x)^3/x^3,x, algorithm="maxima")

[Out]

1/2*b*e*n*(e*log(e*x + d)/(d^2*f^3 - 2*d*e*f^2*g + e^2*f*g^2) - e*log(f*x + g)/(d^2*f^3 - 2*d*e*f^2*g + e^2*f*
g^2) - 1/(d*f^2*g - e*f*g^2 + (d*f^3 - e*f^2*g)*x)) - 1/2*b*log((e*x + d)^n*c)/(f^3*x^2 + 2*f^2*g*x + f*g^2) -
 1/2*a/(f^3*x^2 + 2*f^2*g*x + f*g^2)

Giac [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 201, normalized size of antiderivative = 1.79 \[ \int \frac {a+b \log \left (c (d+e x)^n\right )}{\left (f+\frac {g}{x}\right )^3 x^3} \, dx=\frac {b e^{2} n \log \left (e x + d\right )}{2 \, {\left (d^{2} f^{3} - 2 \, d e f^{2} g + e^{2} f g^{2}\right )}} - \frac {b e^{2} n \log \left (f x + g\right )}{2 \, {\left (d^{2} f^{3} - 2 \, d e f^{2} g + e^{2} f g^{2}\right )}} - \frac {b n \log \left (e x + d\right )}{2 \, {\left (f^{3} x^{2} + 2 \, f^{2} g x + f g^{2}\right )}} - \frac {b e f n x + b e g n + b d f \log \left (c\right ) - b e g \log \left (c\right ) + a d f - a e g}{2 \, {\left (d f^{4} x^{2} - e f^{3} g x^{2} + 2 \, d f^{3} g x - 2 \, e f^{2} g^{2} x + d f^{2} g^{2} - e f g^{3}\right )}} \]

[In]

integrate((a+b*log(c*(e*x+d)^n))/(f+g/x)^3/x^3,x, algorithm="giac")

[Out]

1/2*b*e^2*n*log(e*x + d)/(d^2*f^3 - 2*d*e*f^2*g + e^2*f*g^2) - 1/2*b*e^2*n*log(f*x + g)/(d^2*f^3 - 2*d*e*f^2*g
 + e^2*f*g^2) - 1/2*b*n*log(e*x + d)/(f^3*x^2 + 2*f^2*g*x + f*g^2) - 1/2*(b*e*f*n*x + b*e*g*n + b*d*f*log(c) -
 b*e*g*log(c) + a*d*f - a*e*g)/(d*f^4*x^2 - e*f^3*g*x^2 + 2*d*f^3*g*x - 2*e*f^2*g^2*x + d*f^2*g^2 - e*f*g^3)

Mupad [B] (verification not implemented)

Time = 1.72 (sec) , antiderivative size = 173, normalized size of antiderivative = 1.54 \[ \int \frac {a+b \log \left (c (d+e x)^n\right )}{\left (f+\frac {g}{x}\right )^3 x^3} \, dx=\frac {b\,e^2\,n\,\mathrm {atanh}\left (\frac {2\,d^2\,f^3-2\,e^2\,f\,g^2}{2\,f\,{\left (d\,f-e\,g\right )}^2}+\frac {2\,e\,f\,x}{d\,f-e\,g}\right )}{f\,{\left (d\,f-e\,g\right )}^2}-\frac {b\,\ln \left (c\,{\left (d+e\,x\right )}^n\right )}{2\,f\,\left (f^2\,x^2+2\,f\,g\,x+g^2\right )}-\frac {\frac {a\,d\,f-a\,e\,g+b\,e\,g\,n}{d\,f-e\,g}+\frac {b\,e\,f\,n\,x}{d\,f-e\,g}}{2\,f^3\,x^2+4\,f^2\,g\,x+2\,f\,g^2} \]

[In]

int((a + b*log(c*(d + e*x)^n))/(x^3*(f + g/x)^3),x)

[Out]

(b*e^2*n*atanh((2*d^2*f^3 - 2*e^2*f*g^2)/(2*f*(d*f - e*g)^2) + (2*e*f*x)/(d*f - e*g)))/(f*(d*f - e*g)^2) - (b*
log(c*(d + e*x)^n))/(2*f*(g^2 + f^2*x^2 + 2*f*g*x)) - ((a*d*f - a*e*g + b*e*g*n)/(d*f - e*g) + (b*e*f*n*x)/(d*
f - e*g))/(2*f*g^2 + 2*f^3*x^2 + 4*f^2*g*x)